import jieba
from collections import Counter
# 读取文本文件
with open(r'c:\Users\86178\Desktop\python\Thirdweek\4.9\三国演义.txt', 'r', encoding='utf-8') as file:
    text = file.read()
# 使用 jieba 进行分词
words = jieba.lcut(text)
# 统计词频
word_counts = Counter(words)
# 输出词频
for word, count in word_counts.most_common(100):  # 输出前100个高频词
    print(f"{word}: {count}")